

package top.continew.admin.controller.question;

import org.springframework.web.bind.annotation.*;
import top.continew.admin.question.manger.service.model.KnowledgePointStatisticsQuery;
import top.continew.starter.web.model.R;

/**
 * Created with Mac IntelliJ IDEA
 *
 * @Title: KnowledgePointController
 * @Package: top.continew.question.controller
 * @Author: RHY
 * @Description: 知识点统计
 * @Date: 2020/3/3 09:27
 */
@RestController
@RequestMapping("knowledgePoint")
public class KnowledgePointController {

    /**
     * 知识点题目上架统计查询接口
     *
     * @return
     *
     * @throws Exception
     */

    @PostMapping(value = "/statistics/treeList")
    public R statisticsTreeList(@RequestParam(value = "parentId", defaultValue = "0") Long parentId,
                                @RequestBody KnowledgePointStatisticsQuery query) throws Exception {
        return R.ok(null);
    }

    /**
     * 知识点题目上架统计（合计）
     *
     * @param query
     *
     * @return
     *
     * @throws Exception
     */

    @PostMapping(value = "/statistics/sum")
    public R statisticsSum(@RequestBody KnowledgePointStatisticsQuery query) throws Exception {

        return R.ok(null);
    }

    /**
     * 知识点统计查询接口
     *
     * @return
     *
     * @throws Exception
     */

    @GetMapping(value = "/statistics")
    public R statistics(@RequestParam(value = "pointId") Long pointId) throws Exception {
        return R.ok(null);
    }

    /**
     * 获取知识点树形结构
     *
     * @return
     *
     * @throws Exception
     */

    @GetMapping(value = "/tree")
    public R tree(@RequestParam(value = "parentId", defaultValue = "0") Long parentId) throws Exception {
        return R.ok(null);
    }

    /**
     * 知识点查询题目接口
     *
     * @return
     *
     * @throws Exception
     */
    @GetMapping(value = "/question/page")
    public R questionPage(@RequestParam(value = "pointId") Long pointId,
                          @RequestParam(value = "title", required = false) String title,
                          @RequestParam(value = "questionStatus", required = false) String questionStatus,
                          @RequestParam(value = "questionType", required = false) String questionType) throws Exception {
        return R.ok(null);
    }

    /**
     * 知识点批量上线\下线接口
     *
     * @return
     *
     * @throws Exception
     */

    @PostMapping(value = "/onlineOrOffline")
    public R onlineOrOffline(@RequestParam(value = "pointId", required = true) Long pointId,
                             @RequestParam(value = "type", required = true) int type) throws Exception {
        return R.ok();
    }

    /**
     * 批量上线\下线接口
     *
     * @return
     *
     * @throws Exception
     */

    @PostMapping(value = "/question/onlineOrOffline")
    public R questionOnlineOrOffline(@RequestParam(value = "questionId", required = true) String questionId,
                                     @RequestParam(value = "type", required = true) int type) throws Exception {
        return R.ok();
    }

    @GetMapping(value = "/knowledgePointExceedLimit/{knowledgeId}")
    public R knowledgePointExceedLimit(@PathVariable long knowledgeId) throws Exception {
        return R.ok(null);
    }

    /**
     * 题目导出接口
     *
     * @return
     *
     * @throws Exception
     */

    @GetMapping(value = "/question/export")
    public void questionExport(@RequestParam(value = "questionId", required = true) String questionId) throws Exception {

    }

    /**
     * 获取知识点树形结构（语文）
     *
     * @return
     *
     * @throws Exception
     */

    @GetMapping(value = "/treeYw")
    public R treeYw() throws Exception {
        return R.ok(null);
    }

    /**
     * 知识点查询题目接口
     *
     * @return
     *
     * @throws Exception
     */
    @GetMapping(value = "/questionYw/page")
    public R questionPageYw(@RequestParam(value = "pointId", defaultValue = "7113") Long pointId,
                            @RequestParam(value = "title", required = false) String title,
                            @RequestParam(value = "questionStatus", required = false, defaultValue = "5") String questionStatus,
                            @RequestParam(value = "questionType", required = false) String questionType) throws Exception {

        return R.ok(null);
    }

    /**
     * 获取知识点树形结构（语文）
     *
     * @return
     *
     * @throws Exception
     */

    @GetMapping(value = "/treeSx")
    public R treeSx() throws Exception {
        return R.ok(null);
    }

    /**
     * 知识点查询题目接口
     *
     * @return
     *
     * @throws Exception
     */
    @GetMapping(value = "/questionSx/page")
    public R questionPageSx(@RequestParam(value = "pointId", defaultValue = "7647") Long pointId,
                            @RequestParam(value = "title", required = false) String title,
                            @RequestParam(value = "questionStatus", required = false, defaultValue = "5") String questionStatus,
                            @RequestParam(value = "questionType", required = false) String questionType) throws Exception {

        return R.ok(null);
    }
}
